package org.eclipse.gittab.fretboard.draw2d.figures;

import org.eclipse.draw2d.MidpointLocator;
import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.swt.graphics.Color;

public class StringLine extends PolylineConnection {

	private MidpointLocator mpl;

	private NoteInfoFigure noteInfo;

	public StringLine(Color color, float lineWidth) {

		setLineWidthFloat(lineWidth);
		setForegroundColor(color);

		mpl = new MidpointLocator(this, 0);
	}

	/*
	 * public void mark(String text, Color color) {
	 * 
	 * Label l = new Label(text); l.setForegroundColor(color);
	 * 
	 * this.add(l, mpl); }
	 */

	/**
	 * Adds the {@link NoteInfoFigure} as a child in the middle of the line
	 * (using a {@link MidpointLocator}).
	 */
	public void addNoteInfoFigure(NoteInfoFigure figure) {

		this.noteInfo = figure;
		add(noteInfo, mpl);
	}

	public NoteInfoFigure getNoteInfoFigure() {

		return noteInfo;
	}

}
